#ifndef __METRIC_REPORTER_HPP__
#define __METRIC_REPORTER_HPP__

#include <memory>
#include <atomic>

namespace metrics
{
    class MetricRegistry;

    class MetricReporter
    {
    protected:
        std::shared_ptr<MetricRegistry> _registry;
        std::atomic_bool _running{false};
        long int _interval_sec;
        long int _interval_nsec;

    public:
        MetricReporter() = default;
        virtual ~MetricReporter() = default;

        virtual void run() = 0;

        virtual MetricReporter &register_collectable(std::shared_ptr<MetricRegistry>);
        virtual MetricReporter &interval(long int seconds, long int nano_seconds);
        virtual void start();
        virtual void stop();

    protected:
        virtual void extra_metrics();
    };

} // namespace metrics

#endif // __METRIC_REPORTER_HPP__